package com.sora.controller.api;

import com.sora.model.param.RegisterParam;
import com.sora.model.vo.UserVO;
import com.sora.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;

@Api("用户相关接口")
@RestController
@RequestMapping("api")
public class UserController {

    @Resource
    UserService userService;

    @ApiOperation(value = "用户更新资料--sora")
    @PostMapping("/update")
    public UserVO updateUser(@RequestBody @Valid RegisterParam registerParam) {
        return userService.updateUser(registerParam);
    }
}
